import request from "@/utils/request";

// 课程-学生评价详情
export function getPost_evaluateInfo(courseStuId,teacherId) {
  return request({
    url: "/school/teacher/teachingPage/evaluateInfo/" + courseStuId,
    method: "get",
    params:{
      teacherId:teacherId
    }
  });
}

// 课程-获取详细信息
export function getPost_courseStuDataBase(postId) {
  return request({
    url: "/school/manager/course/courseStuDataBase/" + postId,
    method: "get",
  });
}
// 课程-获取学习详细信息
export function getPost_courseStuData(query) {
  return request({
    url: "/school/manager/course/courseStuData",
    method: "get",
    params: query,
  });
}

// 获取课程列表
export function getTeaCourseList(query) {
  return request({
    url: `/school/manager/course/teaCourseList`,
    method: "get",
    params: query,
  });
}

// 获取学校所有课程（教务端）
export function allCourseList(query) {
  return request({
    url: `/school/manager/course/list`,
    method: "get",
    params: query,
  });
}

// 获取学校所有教师（教务端）
export function allTeacherList(query) {
  return request({
    url: `/school/manager/account/teacher/list`,
    method: "get",
    params: query,
  });
}

// 获取详细信息 manager:course:query
export function getCourseDetial(courseId) {
  return request({
    url: '/school/manager/course/' + courseId,
    method: 'get'
  })
}

// 课程目录-获取右边详细信息
export function getCourseIndexDetial(indexId) {
  return request({
    url: '/school/manager/courseIndex/' + indexId,
    method: 'get'
  })
}

// 课程目录-根据课程Id获取课程目录tree结构
export function getCourseIndexTree(courseId) {
  return request({
    url: '/school/manager/courseIndex/tree/' + courseId,
    method: 'get'
  })
}
// 管理-复制课程到别的学校  manager:course:copyCourseToOtherSchool
export function copyCourseToOtherSchool(schoolId,teacherId,courseIds) {
  return request({
    url: `/school/manager/course/copyCourseToOtherSchool/${schoolId}/${teacherId}/${courseIds}`,
    method: 'post'
  })
}

// 新增课程
export function addCourse(data) {
  return request({
    url: '/school/manager/course/addCourse',
    method: 'post',
    data: data
  })
}
// 修改课程
export function editCourse(data) {
  return request({
    url: '/school/manager/course/editCourse',
    method: 'put',
    data: data
  })
}

// 配分-获取列表
export function getDistributionList(courseId) {
  return request({
    url: '/school/manager/courseIndex/getDistributionList/' + courseId,
    method: 'get'
  })
}

// 配分-提交配分
export function submitDistribution(data) {
  return request({
    url: '/school/manager/courseIndex/submitDistribution',
    method: 'put',
    data:data
  })
}

// 课程-修改状态
export function editCourseStatus(type,courseId,data) {
  return request({
    url: `/school/manager/course/editCourseStatus/${type}/${courseId}`,
    method: 'put',
    data:data
  })
}

// 撤销编辑课程
export function revokeCourse(courseId) {
  return request({
    url: '/school/manager/course/revokeCourse/'+courseId,
    method: 'put',
  })
}

// 复制正式课程
export function copyCourse(courseId) {
  return request({
    url: '/school/manager/course/copy/' + courseId,
    method: 'post',
  })
}


// 删除课程
export function delCourse(courseIds) {
  return request({
    url: '/school/manager/course/' + courseIds,
    method: 'delete'
  })
}

// 专业名称-获取列表
export function getMajorNameList(params) {
  return request({
    url: '/school/manager/course/getMajorNameList',
    method: 'get',
    params: params
  })
}

// 学生--------------
// 记录步骤学习时长
export function recordStudyTime(studyRecordId, studyTime) {
  return request({
    url: `/school/student/courseStudyManager/recordStudyTime/${studyRecordId}/${studyTime}`,
    method: "post"
  });
}
// 任务学习完成
export function finishStudyContent(indexId, studyTime) {
  return request({
    url: `/school/student/courseStudyManager/taskComplete/${indexId}/${studyTime}`,
    method: "post"
  });
}

// 课程-获取课程明细当前总配分
export function checkScorePercent(courseId) {
  return request({
    url: "/school/manager/course/checkScorePercent/" + courseId,
    method: "get",
  });
}


// 初始化工学一体模板
export function initTemplate(courseId) {
  return request({
    url: "/school/manager/courseIndex/initTemplate/" + courseId,
    method: "post",
  });
}




// 课程目录-删除
export function deleteCourseIndex(ids,params) {
  return request({
    url: "/school/manager/courseIndex/" + ids,
    method: "delete",
    params:params
  });
}

// 课程目录-新增
export function addCourseIndex(data) {
  return request({
    url: "/school/manager/courseIndex",
    method: "post",
    data: data,
  });
}

// 课程目录-修改
export function editCourseIndex(data) {
  return request({
    url: "/school/manager/courseIndex",
    method: "put",
    data,
  });
}

// 课程目录-排序
export function sortCourseIndex(ids) {
  return request({
    url: "/school/manager/courseIndex/sort/" + ids,
    method: "put",
  });
}

// 目录属性-新增
export function addProperties(data) {
  return request({
    url: "/school/manager/courseIndex/param",
    method: "post",
    data: data,
  });
}

// 目录属性-新增
export function deleteProperties(ids) {
  return request({
    url: "/school/manager/courseIndex/param/" + ids,
    method: "delete",
  });
}

// 权限控制
export function editCourseLearningResultstate(courseId, learningResultState) {
  return request({
    url: `/school/manager/course/editCourseLearningResultState/${courseId}/${learningResultState}`,
    method: "put",
  });
}

// 内容层-----教学内容新增
export function addCourseContent(data) {
  return request({
    url: "/school/manager/courseContent/add",
    method: "post",
    data: data,
  });
}

// 内容层-----教学内容删除
export function deleteCourseContent(contentId) {
  return request({
    url: "/school/manager/courseContent/" + contentId,
    method: "delete",
  });
}

// 内容层-----教学内容修改
export function editCourseContent(data) {
  return request({
    url: "/school/manager/courseContent/edit",
    method: "put",
    data: data,
  });
}

// 内容层-----教学内容排序
export function sortCourseContent(contentIds) {
  return request({
    url: "/school/manager/courseContent/sort/" + contentIds,
    method: "put",
  });
}
// 获取可恢复学习记录列表
export function getRecoverStudyRecordList(query) {
  return request({
    url: "/school/teacher/courseTeaching/getRecoverStudyRecordList",
    method: "get",
    params: query,
  });
}

// 编辑课程
export function editCourseCount(courseId) {
  return request({
    url: "/school/manager/course/teacherEditCourse/" + courseId,
    method: "post",
  });
}


// 课程目录-获取课程下有哪些目录存在异常考核
export function getExceptionExam(courseId) {
  return request({
    url: `/school/manager/courseIndex/exceptionExamAndWorkAndPractice/${courseId}`,
    method: "get",
  });
}

// 课程目录-判断目录及子目录下是否有试题
export function getHasTopic(indexId) {
  return request({
    url: `/school/manager/courseIndex/hasTopic/${indexId}`,
    method: "get",
  });
}

// 课程目录-获取目录及子目录试题在哪些其他目录试卷中被引用
export function getIndexListWhichUsedTopicInThisIndex(indexId) {
  return request({
    url: `/school/manager/courseIndex/indexListWhichUsedTopicInThisIndex/${indexId}`,
    method: "get",
  });
}
//课程目录-根据indexld获取ancestorsName
export function getAncestorsNameApi(indexId) {
  return request({
    url: `/school/manager/courseIndex/getAncestorsName/${indexId}`,
    method: 'get',
  })
}

// 任务详细
// 修改信息页 工作页
export function batchEditContentType(data) {
  return request({
    url: "/school/manager/courseContent/batchEditContentType" ,
    method: "put",
    data:data
  });
}

